package Tests.figuren;

import java.util.ArrayList;


import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import schach.server.model.Brett;
import schach.server.model.Feld;
import schach.server.model.Figur;
import schach.server.model.Springer;

public class SpringerTest {

	private static ArrayList<ArrayList<Feld>> felder;
	private ArrayList<Feld> crossed;
	private Figur figur;

	@BeforeClass
	public static void firstSetUp() {
		Brett brett = new Brett();
		ArrayList<ArrayList<Feld>> feldr = brett.getFelder();
		felder = brett.getFelder();

	}

	@Before
	public void setUp() {
		Feld feld = felder.get(1).get(0);
		figur = new Springer(feld, true, true);
		feld.setFigur(figur);
		System.out.println(figur.getPosition().toString());
		crossed = new ArrayList<Feld>();

	}

	@Test
	public void testeTurm() {
		try {
			crossed = figur.crossedFields(felder.get(3).get(1));
			figur.move(felder.get(3).get(1));
			System.out.println(felder.get(3).get(1).toString() + " korrekt");
		} catch (Exception e) {
			System.out.println("Error");
		}
		// for (int i = 0; i < 8; i++) {
		// for (int j = 0; j < 8; j++) {
		// try{
		// crossed = figur.crossedFields(felder.get(i).get(j));
		// figur.move(felder.get(i).get(j));
		// System.out.println(felder.get(i).get(j).toString() + " korrekt");
		// } catch (Exception e){
		// System.out.println("Error");
		// }
		// }
		// }

	}
}